<?php

/*
* StiPHPcms, A web Content management System made with PHP/MySQL
* JordSti : jord52@gmail.com
* Version : 0.0.1
*
* Copyright (C) 2009  jord52@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/


include "core/main.php";

$page = new CMSPage($cms_config);
$page->sql_init();

if(count($page->settings)==0)
{
	//First RUN
	$page->addSetting('theme','blue_sti');
	$page->addSetting('lang','en');
	$page->addSetting('footertext','Copyright %site - %year');
	$page->addSetting('admin_rank',1024);
	$page->addSetting('meta_keywords');
	$page->addSetting('meta_description');
	$page->addSetting('avatar_max_x',120);
	$page->addSetting('avatar_max_y',120);
	
	$page->sql_query("INSERT INTO %prefix%modules VALUES('','news','news.php',0,1)");
	$page->sql_query("INSERT INTO %prefix%modules VALUES('','download','download.php',1,1)");
	
	$page->sql_query("INSERT INTO %prefix%menu VALUES('','Main menu','MENUTAB',1,0)");
	$page->sql_query("INSERT INTO %prefix%menu VALUES('','News','index.php',2,0)");
	$page->sql_query("INSERT INTO %prefix%menu VALUES('','Download','mod.php?mod=download',6,0)");
	$page->sql_query("INSERT INTO %prefix%menu VALUES('','__Admin','admin.php',15,1024)");
	
	$page->sql_query("INSERT INTO %prefix%navbar VALUES('','News','index.php',1,0)");
	$page->sql_query("INSERT INTO %prefix%navbar VALUES('','My profile','myprofile.php',4,1)");

	$page->init();
	$page->renderHeader('First Run',true,'index.php');
	$page->renderMenu();
	$page->template->addFrame('','First Run !');
	$page->close();
}
else
{
	$page->init();
	$page->moduleLoader("news");
	$page->close();
}

?>